//
//  MCGlobelConst.h
//  
//
//  Created by Canny on 2018/10/19.
//  Copyright © 2018年 WK. All rights reserved.
//

#import <Foundation/Foundation.h>

#define MC_BALLSELECRED_COLOR [UIColor colorWithRed:0 green:130/255.0 blue:210/255.0 alpha:1]
#define MC_BALLNORMAL_COLOR [UIColor colorWithRed:187/255.0 green:187/255.0 blue:187/255.0 alpha:1]
#define MC_FILTER_COLOR [UIColor colorWithRed:239/255.0 green:239/255.0 blue:239/255.0 alpha:1]
#define MC_ColorWithAlpha(r, g, b, a) [UIColor colorWithRed:(r) / 255.0 green:(g) / 255.0 blue:(b) / 255.0 alpha:a]
#define MC_SKYBLUE_COLOR RGB(54, 128, 211)
#define MC_SEPAETOR_COLOR RGB(182, 182, 182)

#define RGB(__r, __g, __b)  [UIColor colorWithRed:(1.0*(__r)/255)\
green:(1.0*(__g)/255)\
blue:(1.0*(__b)/255)\
alpha:1.0]
#define MC_REALVALUE(value)  ceil((value)/375.0f*[UIScreen mainScreen].bounds.size.width)


// iPhone4S

#define IS_iPhone_4S ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)

// iPhone5 iPhone5s iPhoneSE

#define IS_iPhone_5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)

// iPhone6 7 8

#define IS_iPhone_6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? (CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) || CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size)) : NO)

// iPhone6plus  iPhone7plus iPhone8plus

#define IS_iPhone6_Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? (CGSizeEqualToSize(CGSizeMake(1125, 2001), [[UIScreen mainScreen] currentMode].size) || CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size)) : NO)

// iPhoneX

#define IS_iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
// iPhoneXR

#define IS_iPhone_Xr ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) : NO)
// iPhoneXS

#define IS_iPhone_Xs ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
// iPhoneXS MAX

#define IS_iPhone_Xs_Max ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size) : NO)


#define G_SCREENWIDTH  ([UIScreen mainScreen].bounds.size.width)

#define G_SCREENHEIGHT ([UIScreen mainScreen].bounds.size.height)

//导航栏的高度kIs_iPhoneX
#define kStatusBarAndNavigationBarHeight ((IS_iPhoneX==YES || IS_iPhone_Xr ==YES || IS_iPhone_Xs== YES || IS_iPhone_Xs_Max== YES) ? 88.f : 64.f)
//导航栏的高度kIs_iPhoneX
#define kTabBarHeight ((IS_iPhoneX==YES || IS_iPhone_Xr ==YES || IS_iPhone_Xs== YES || IS_iPhone_Xs_Max== YES) ? 83.f : 49.f)
//导航栏的高度kIs_iPhoneX 差值
#define kStatusBarAndNavigationBarHeightDifference ((IS_iPhoneX==YES || IS_iPhone_Xr ==YES || IS_iPhone_Xs== YES || IS_iPhone_Xs_Max== YES) ? 24.f : 0.f)
//导航栏的高度kIs_iPhoneX 高度
#define kStatusTopNavDifference ((IS_iPhoneX==YES || IS_iPhone_Xr ==YES || IS_iPhone_Xs== YES || IS_iPhone_Xs_Max== YES) ? 44.f : 20.f)
//主题色
#define MC_THEME_COLOR RGB(82, 80, 174)

#define MCTEST_BASE_API  @"http://026api.mc.corp/"

#define SEVERBASEURL [MCGlobelConst serverBaseURL]



//默认线路 比对跟那一条一样 就是谁 （swift 不支持宏定义的这种写法 默认线路只能这么做）
/**声明这个宏定义,主要是用于Masonry中的block中(防止循环引用)*/
#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;
#define MHweakSelf __weak __typeof__ (self) wself = self;



@interface MCGlobelConst : NSObject

@end
